 

#pragma once
 

namespace Ogitors
{

	class  mirrorEditor : public CNodeEditor
	{
		friend class CMirrorEditorFactory;
	public:
		void					GetObjectUserData(std::ofstream &outfile);
		virtual void            GetObjectProperties(Ogre::NameValuePairList &retList);
		virtual void			SetHandle(void *objHandle,bool display);
		virtual bool			SetupPropertiesWnd();
		virtual void            FreeHandle();
		virtual void            ShowBoundingBox(bool bShow);
		virtual Ogre::AxisAlignedBox GetAABB() {return m_PlaneHandle->getBoundingBox();};
		/// Overridden by Editor Objects to Import Object Dependant Properties
		virtual CBaseEditor    *Restore(Ogre::NameValuePairList &retList);
		/// Gets the Handle to encapsulated object
		inline virtual void    *GetHandle() {return static_cast<void*>(m_PlaneHandle);};
		/// Returns the Factory associated with this object
		static CBaseEditorFactory *GetFactory();
		/// Returns the Factory associated with this object can be overridden
		virtual CBaseEditorFactory *GetFactoryDynamic();
		/// Gets Object's Cast Shadows Property 
		virtual bool			GetCastShadows() {return m_PlaneHandle->getCastShadows();};

		virtual void    SetCastShadows(int BIND_ID,Ogre::String val,bool refresh);
		virtual bool				 Update(float timePassed) ;
	protected:
		//CReflection  * m_CReflection;
		Ogre::Entity *m_PlaneHandle;
		Ogre::Vector3 m_Normal;
		Ogre::Real    m_Distance;
		Ogre::Real    m_Width;
		Ogre::Real    m_Height;
		int           m_xSegments;
		int           m_ySegments;
		int           m_NumCoordSets;
		int           m_uTile;
		int           m_vTile;
		bool          m_HasNormals;
		Ogre::String  m_BlockTexture;
		Ogre::MovablePlane   m_plane;
		mirrorEditor(Ogre::String typestring = "Mirror Object", EDITORTYPE etype = ETYPE_PLANE);
		virtual       ~mirrorEditor();
		virtual bool  HandleCustomFunction(int BIND_ID,Ogre::String val);
		Ogre::Entity *CreatePlane();
	};

	class  CMirrorEditorFactory: public CBaseEditorFactory
	{
	public:
		CMirrorEditorFactory() {};
		virtual ~CMirrorEditorFactory() {};
		virtual CBaseEditor *CreateObject(CBaseEditor **parent, Ogre::NameValuePairList &params);
	};
 
}
